home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / c / EGCSWOSAlib.lha / src.lha / stricmp.c < prev    next >
C/C++ Source or Header  |  1999-01-06  |  479b  |  23 lines

  1. #include <ctype.h>
  2. #include <string.h>
  3.  
  4. /*
  5. ** stricmp() - Compare two strings in casesensitivly.
  6. **
  7. ** Made by Kasper B. Graversen (c) 1996
  8. **
  9. ** fixed by phx 01/98
  10. **
  11. ** This is freeware - use at own risc.
  12. */
  13.  
  14. int strcasecmp(const char *str1, const char *str2)
  15. {
  16.     while(tolower((unsigned char)*str1) == tolower((unsigned char)*str2)) {
  17.         if(!*str1) return(0);
  18.         str1++;str2++;
  19.     }
  20.     return(tolower(*(unsigned char *)str1)-tolower(*(unsigned char *)str2));
  21. }
  22.  
  23.